package org.dromara.batch;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;

// 购买理财产品任务
public class BuyProductTasklet implements Tasklet {
    private FinanceAccountService financeAccountService;

    public BuyProductTasklet(FinanceAccountService financeAccountService) {
        this.financeAccountService = financeAccountService;
    }

    @Override
    public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        financeAccountService.buyProduct();
        return RepeatStatus.FINISHED;
    }
}